﻿<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <title></title>
</head>
<body>
    <script>
        //整形：integer 浮点型：float
        let age = 11.1;
        //1.字符串转化为number
        age = parseFloat(age);
        //age = parseInt(age);
        console.log(age);
        console.log(typeof age);

        //NaN not a number
        age = parseInt('剑圣');
        console.log(age);

        //3.强制转化 number
        let score = Number('123');
        console.log(typeof score);


    </script>
</body>
</html>